<template>
  <div>
    <router-link to="/error">
      <div class="error" v-if="errorNum > 0">
        您的设备有{{errorNum}}台存在异常
      </div>
    </router-link>
    <div class="error statusOk" v-if="errorNum === 0">
      设备正常
    </div>
  </div>
</template>

<script>
export default {
  name: 'error',
  props: ['errorNum']
}
</script>

<style scoped>
  .error{
    margin-top: 0.2rem;
    width: 7.5rem;
    height: 1.9rem;
    line-height: 1.9rem;
    font-size: 0.36rem;
    color: #fff;
    text-align: center;
    background-color: #f95757;
  }

  .statusOk {
    background-color: #09BB07!important;
  }
</style>
